<template>
  <div class="hello">
    <button @click="Addnum(index)">+</button>
    <span>{{ shoppingCart[index].num }}</span>
    <button @click="Subnum(index)">-</button>
  </div>
</template>

<script>
import { mapState, mapMutations } from 'vuex'
export default {
  name: 'NumBore',
  props: {
    index:Number
  },
  data () {
    return {
    }
  },
  // ... existing code ...
  computed: {
    ...mapState('shopping', ['shoppingCart'])
  },
  methods: {
    ...mapMutations('shopping', ['Addnum', 'Subnum']),
  }
}
</script>

<style scoped>
/* 可以适当调整样式 */
button {
  cursor: pointer;
}
span {
  margin: 0 10px; 
}
</style>